// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const env = "fz-xiaochengxu-3ggm49cn525bedba";
const db = cloud.database({env});

// 云函数入口函数
exports.main = async (event, context) => {
    return db.collection("userInfo").add({
        data: {
          name:event.name,
          gender:event.gender,
          date:event.date,
          userId:event.userId,
          date:db.serverDate()
        }
    });
}